/* __auth__ : KunLin */

package com.cskaoyan.bean.vo.goods;

import com.cskaoyan.bean.Comment;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@NoArgsConstructor
@Data
public class WXGoodsDetailVO {

    private Integer errno;
    private DataDTO data;
    private String errmsg;

    public WXGoodsDetailVO success() {
        this.setErrno(0);
        this.setErrmsg("成功");
        return this;
    }

    @NoArgsConstructor
    @Data
    public static class DataDTO {
        private List<SpecificationListDTO> specificationList;
        private List<?> groupon;
        private List<IssueDTO> issue;
        private Integer userHasCollect;
        private String shareImage;
        private CommentDTO comment;
        private Boolean share;
        private List<AttributeDTO> attribute;
        private BrandDTO brand;
        private List<ProductListDTO> productList;
        private InfoDTO info;

        @NoArgsConstructor
        @Data
        public static class CommentDTO {
            private List<CommentDataDTO> data;
            private Integer count;
        }

        @NoArgsConstructor
        @Data
        public static class BrandDTO {
            private Integer id;
            private String name;
            private String desc;
            private String picUrl;
            private Byte sortOrder;
            private BigDecimal floorPrice;
            private Date addTime;
            private Date updateTime;
            private Boolean deleted;
        }

        @NoArgsConstructor
        @Data
        public static class InfoDTO {
            private Integer id;
            private String goodsSn;
            private String name;
            private Integer categoryId;
            private Integer brandId;
            private String[] gallery;
            private String keywords;
            private String brief;
            private Boolean isOnSale;
            private Short sortOrder;
            private String picUrl;
            private String shareUrl;
            private Boolean isNew;
            private Boolean isHot;
            private String unit;
            private BigDecimal counterPrice;
            private BigDecimal retailPrice;
            private Date addTime;
            private Date updateTime;
            private Boolean deleted;
            private String detail;
        }

        @NoArgsConstructor
        @Data
        public static class SpecificationListDTO {
            private String name;
            private List<ValueListDTO> valueList;

            @NoArgsConstructor
            @Data
            public static class ValueListDTO {
                private Integer id;
                private Integer goodsId;
                private String specification;
                private String value;
                private String picUrl;
                private Date addTime;
                private Date updateTime;
                private Boolean deleted;
            }
        }

        @NoArgsConstructor
        @Data
        public static class IssueDTO {
            private Integer id;
            private String question;
            private String answer;
            private Date addTime;
            private Date updateTime;
            private Boolean deleted;
        }

        @NoArgsConstructor
        @Data
        public static class AttributeDTO {
            private Integer id;
            private Integer goodsId;
            private String attribute;
            private String value;
            private Date addTime;
            private Date updateTime;
            private Boolean deleted;
        }

        @NoArgsConstructor
        @Data
        public static class ProductListDTO {
            private Integer id;
            private Integer goodsId;
            private String[] specifications;
            private BigDecimal price;
            private Integer number;
            private String url;
            private Date addTime;
            private Date updateTime;
            private Boolean deleted;
        }
    }

    @NoArgsConstructor
    @Data
    public static class CommentDataDTO {
        private Date addTime;
        private String[] picList;
        private String adminContent;
        private String nickname;
        private Integer id;
        private String avatar;
        private String content;
    }
}
